#include<iostream>
using namespace std;

template <typename T>
class Rectangle{
    public:
        friend T;
        Rectangle(int w,int h):width(w),height(h){}
        void set(int w,int h){
            width=w;
            height=h;
        }
        int getW(){
            return width;
        }
        int getH(){
            return height;
        }
    private:
        int width;
        int height;
};

template <typename T>
class Circle{
    public:
        friend T;
        Circle(int r):radius(r){};
        void set(int r){
            radius=r;
        }
        int getR(){
            return radius;
        }
    private:
        int radius;
};

//验证类
class Verify{
    public:
        void VerifyRectangle(int w,int h,Rectangle<Verify> &r){
            if(r.getW()>=w&&r.getH()>=h){
                cout<<"success rectangle!!!"<<endl;
            }else{
                cout<<"error"<<endl;
            }
        }
        void VerifyCircle(int r,Circle<Verify> &c){
            if(c.getR()>=r){
                cout<<"success!!!"<<endl;
            }else{
                cout<<"error"<<endl;
            }
        }
};

int main(){
    Verify v;
    Rectangle<Verify> rec(5,6);
    rec.set(9,9);
    Circle<Verify> circle(3);
    v.VerifyRectangle(7,8,rec);
    v.VerifyCircle(1,circle);
    return 0;
}